package flyweight.extrinsic;

public class Client {
    public static void main(String args[]) {
        //NetworkDevice nd1, nd2, nd3, nd4, nd5;
        DeviceFactory df = new DeviceFactory();

        String[] deviceTypes = {"cisco", "cisco", "cisco", "tp", "tp"};
        String[] ports = {"1000", "1001", "1002", "1003", "1004"};

        for (int i = 0; i < deviceTypes.length; i++) {
            df.getNetworkDevice(deviceTypes[i]).use(new Port(ports[i]));
        }



//
//		nd1=df.getNetworkDevice("cisco");
//		nd1.use(new Port("1000"));
//
//		nd2=df.getNetworkDevice("cisco");
//		nd2.use(new Port("1001"));
//
//		nd3=df.getNetworkDevice("cisco");
//		nd3.use(new Port("1002"));
//
//		nd4=df.getNetworkDevice("tp");
//		nd4.use(new Port("1003"));
//
//		nd5=df.getNetworkDevice("tp");
//		nd5.use(new Port("1004"));

        System.out.println("Total Device:" + df.getTotalDevice());
        System.out.println("Total UsageCount:" + df.getTotalUsageCount());
    }
}